<template>
	<div class="switch-wrapper">
		<el-switch :inactive-text="label" v-model="status" active-color="#13ce66" inactive-color="#eee" @change="changeValue" :disabled="disabled"> </el-switch>
	</div>
</template>

<script>
export default {
	props: {
		value: {
			type: Boolean,
			default: () => false
		},
		disabled: {
			type: Boolean,
			default: () => false
		},
		label: {
			type: String,
			default: () => ''
		}
	},
	watch: {
		value(val) {
			this.status = val;
		}
	},
	mounted() {
		this.status = this.value;
		console.log('switchXX', this.status);
	},
	data() {
		return {
			status: false
		};
	},
	methods: {
		changeValue() {
			this.$emit('changeValue', this.status);
		}
	}
};
</script>

<style></style>
